// 引入 mongoose 模块
const mongoose = require('mongoose')

// 创建文档的结构对象
const AccountSchema = new mongoose.Schema({
    title: {
        type: String,
        required: true,
    },
    time: Date,
    type: {
        type: Number,
        default: -1.
    },
    account: {
        type:Number,
        required: true,
    },
    remarks: {
        type: String
    }
})

// 创建模型对象 对文档操作额封装
const AccountModel = mongoose.model('account', AccountSchema)

// 导出模型对象
module.exports = AccountModel
